import Vue from "vue";
import Vuex from 'vuex';

Vue.use(Vuex)

const state = {
  count:0,
  price:599
}

const mutations = {
  increment(state){
    state.count++
  },
  incrementN(state,{n}){
    state.count+=n
  }
}

const actions = {
  incrementWait({commit}){
    setTimeout(() => {
      commit('increment')
    },2000)
  }
}
export default new Vuex.Store({
  state,
  mutations,
  actions
})